.class public Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;
.super Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;
.source "ScriptInterstitialOverlay.java"

# interfaces
.implements Lcom/burstly/lib/component/networkcomponent/burstly/html/IJsBridge;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Lcom/burstly/lib/util/UiSafeWebView;",
        ":",
        "Lcom/burstly/lib/component/networkcomponent/IActivityLifeCycleAware;",
        ">",
        "Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer",
        "<TT;>;",
        "Lcom/burstly/lib/component/networkcomponent/burstly/html/IJsBridge;"
    }
.end annotation


# direct methods
.method public constructor <init>(Lcom/burstly/lib/util/UiSafeWebView;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 40
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay<TT;>;"
    .local p1, child:Lcom/burstly/lib/util/UiSafeWebView;,"TT;"
    const-string v0, "burstlyScript"

    invoke-direct {p0, p1, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;-><init>(Landroid/view/View;Ljava/lang/String;)V

    .line 41
    const-string v0, "ScriptActivity"

    invoke-virtual {p1, p0, v0}, Landroid/webkit/WebView;->addJavascriptInterface(Ljava/lang/Object;Ljava/lang/String;)V

    .line 42
    return-void
.end method


# virtual methods
.method public closeActivity()V
    .locals 1

    .prologue
    .line 58
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, p0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 59
    return-void
.end method

.method public getSdkVersion()V
    .locals 3

    .prologue
    .line 78
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->getChildView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/util/UiSafeWebView;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "javascript: if (window.burstlySdkVersion != null) window.burstlySdkVersion(\'"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    sget-object v2, Lcom/burstly/lib/constants/Constants;->SDK_VERSION:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\')"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/burstly/lib/util/UiSafeWebView;->loadUrl(Ljava/lang/String;)V

    .line 81
    return-void
.end method

.method public hideOverlayed()V
    .locals 2

    .prologue
    .line 52
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->getChildView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/util/UiSafeWebView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/burstly/lib/util/UiSafeWebView;->setHostingOverlay(Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;)V

    .line 53
    invoke-super {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->hideOverlayed()V

    .line 54
    return-void
.end method

.method public openExternalURL(Ljava/lang/String;)V
    .locals 6
    .parameter "url"

    .prologue
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay<TT;>;"
    const/4 v5, 0x0

    .line 63
    if-eqz p1, :cond_0

    .line 65
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 66
    .local v1, intent:Landroid/content/Intent;
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 74
    .end local v1           #intent:Landroid/content/Intent;
    :goto_0
    return-void

    .line 68
    :catch_0
    move-exception v0

    .line 69
    .local v0, anfe:Ljava/lang/Exception;
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->TAG:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v4

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 72
    .end local v0           #anfe:Ljava/lang/Exception;
    :cond_0
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->TAG:Ljava/lang/String;

    const-string v4, "External url to open is NULL"

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0
.end method

.method public showOverlayed()V
    .locals 1

    .prologue
    .line 46
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ScriptInterstitialOverlay;->getChildView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/util/UiSafeWebView;

    invoke-virtual {v0, p0}, Lcom/burstly/lib/util/UiSafeWebView;->setHostingOverlay(Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;)V

    .line 47
    invoke-super {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/FullscreenOverlayContainer;->showOverlayed()V

    .line 48
    return-void
.end method
